import {MainData} from "../../coreModule/data/BaseData";
import {field} from "../../coreModule/data/DataLoader";
import {dataClass} from "../../coreModule/managers/DataManager";
import {BaseRepository, getRepository, repository} from "../../coreModule/data/BaseRepository";
import {Constructor} from "../../../utils/BaseContext";
import {Exam} from "./Exam";

export enum QuestionType {
	Fill
}

@dataClass("Question")
export class Question extends MainData{

	@field(String)
	public title: string;
	@field
	public type: QuestionType = QuestionType.Fill;
	@field(Number)
	public score: number;

}

export function quesRepo() {
	return getRepository(QuestionRepo);
}

@repository
class QuestionRepo extends BaseRepository<Question> {
	get clazz(): Constructor<Question> { return Question; }
	constructor() { super(); }

}
